<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<!-- 6 10 2 15 30 9 最大(最小)-->
		<script type="text/javascript">
			var a = [6, 10, 2, 15, 30, 9];
			var max = a[0];
			for (var i = 0; i < a.length; i++) {
                  if(a[i] > max){
					  max = a[i];
				  }
			}
			console.log(max);

			/* arr[0] > arr[1]
			
			arr[1] > arr[2]
			
			arr[1] > arr[3]
			
			arr[3] > arr[4]
			
			arr[4] > arr[5]
			
			arr[4] */
		</script>

	</body>
</html>
